#include "Rectangle.hpp"

namespace rgui
{

Rectangle::Rectangle(const rgui::vec2f &position, const rgui::vec2f &size) : 
	mPosition(position),
	mSize(size)
{

}

const rgui::vec2f& Rectangle::getPosition()
{
	return mPosition;
}

const rgui::vec2f& Rectangle::getSize()
{
	return mSize;
}

void Rectangle::setPosition(const rgui::vec2f &position)
{
	mPosition = position;
}

void Rectangle::setSize(const rgui::vec2f &size)
{
	mSize = size;
}

bool Rectangle::contains(const rgui::vec2f &position)
{
	return position.x >= mPosition.x && position.x <= mPosition.x + mSize.width
		&& position.y >= mPosition.y && position.y <= mPosition.y + mSize.height;
}

}